B2G/Bluetooth/WebBluetooth-v2/BluetoothDeviceEvent: Difference between revisions
< B2G | Bluetooth | WebBluetooth-v2
Jump to navigation
Jump to search
(→device) |
|||
| Line 16: | Line 16: | ||
=== device === | === device === | ||
; Description | ; Description | ||
: The found/paired remote device. The property is null for event handler [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#ondeviceunpaired|adapter.ondeviceunpaired]] since the event handler only requires the address of unpaired device. | : The found remote device ([[B2G/Bluetooth/WebBluetooth-v2/BluetoothDiscoveryHandle#ondevicefound|discoveryHandle.ondevicefound]]) or the paired remote device ([[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#ondevicepaired|adapter.ondevicepaired]]). The property is null for event handler [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#ondeviceunpaired|adapter.ondeviceunpaired]] since the event handler only requires the address of unpaired device. | ||
; Value type | ; Value type | ||
Revision as of 10:11, 21 August 2014
Overview
BluetoothDeviceEvent is carried as the parameter of remote device found, paired, and unpaired event handlers, including discoveryHandle.ondevicefound, adapter.ondevicepaired, adapter.ondeviceunpaired. Applications can get the found/paired BluetoothDevice object or the address of unpaired remote device.
Interface
[CheckPermissions="bluetooth"]
interface BluetoothDeviceEvent : Event
{
readonly attribute BluetoothDevice? device;
readonly attribute DOMString? address;
};
Properties
device
- Description
- The found remote device (discoveryHandle.ondevicefound) or the paired remote device (adapter.ondevicepaired). The property is null for event handler adapter.ondeviceunpaired since the event handler only requires the address of unpaired device.
- Value type
- BluetoothDevice
address
- Description
- The address of unpaired remote device. The property is null for event handlers discoveryHandle.ondevicefound and adapter.ondevicepaired since BluetoothDevice already has property address.
- Value type
- DOMString