B2G/Bluetooth/WebBluetooth-v2/BluetoothDeviceEvent: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
Line 15: Line 15:
=== device ===
=== device ===
; Description
; Description
: The paired remote device.
: The 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.


; Value type
; Value type
: [[B2G/Bluetooth/WebBluetooth-v2/BluetoothDevice|BluetoothDevice]]
: [[B2G/Bluetooth/WebBluetooth-v2/BluetoothDevice|BluetoothDevice]]
; Default Value
: Null pointer


=== address ===
=== address ===
; Description
; Description
: The address of unpaired remote device.
: The address of unpaired remote device. The property is null for event handler [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#ondevicepaired|adapter.ondevicepaired]] since [[B2G/Bluetooth/WebBluetooth-v2/BluetoothDevice|BluetoothDevice]] already has property [[B2G/Bluetooth/WebBluetooth-v2/BluetoothDevice#address|address]].  


; Value type
; Value type
: DOMString
: DOMString
; Default Value
: Empty string ("")

Revision as of 04:20, 16 April 2014

Overview

BluetoothDeviceEvent is carried as the paramter of remote device paired/unpaired event handlers, including adapter.ondevicepaired and adapter.ondeviceunpaired. Applications can get the paired BluetoothDevice object or the address of unpaired remote device.

Interface

interface BluetoothDeviceEvent : Event
{
  readonly attribute BluetoothDevice? device;
  readonly attribute DOMString?       address;
};

Properties

device

Description
The paired remote device. 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 handler adapter.ondevicepaired since BluetoothDevice already has property address.
Value type
DOMString