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

From MozillaWiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
== Overview ==
== Overview ==
The BluetoothDeviceEvent API provides access to a Bluetooth device when the ''devicefound'' event is fired. See [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#startDiscovery.28.29 BluetoothStartDiscoveryRequest.ondevicefound] for more information. <br>
'''BluetoothDeviceEvent''' is carried as the argument of [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#ondevicepaired adapter.ondevicepaired] and [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#ondeviceunpaired adapter.ondeviceunpaired] event handlers. Applications can get the paired [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothDevice BluetoothDevice] object or the address of unpaired remote device.
This interface inherits from the [https://developer.mozilla.org/en-US/docs/Web/API/Event Event] interface.


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


== Properties ==
== Properties ==
* [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothDeviceEvent#adapter BluetoothAdapterEvent.device]
* [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothDeviceEvent#device BluetoothAdapterEvent.device]
* [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothDeviceEvent#address BluetoothAdapterEvent.address]


=== device ===
=== device ===
; Description
; Description
: A BluetoothDevice object representing the device to access
: The paired remote device.


; Value type
; Value type
: [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothDevice BluetoothDevice]
: [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothDevice BluetoothDevice]
; Default Value
: Null pointer
=== address ===
; Description
: The address of unpaired remote device.
; Value type
: DOMString
; Default Value
: Empty string ("")

Revision as of 03:23, 21 March 2014

Overview

BluetoothDeviceEvent is carried as the argument of adapter.ondevicepaired and adapter.ondeviceunpaired event handlers. 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.
Value type
BluetoothDevice
Default Value
Null pointer

address

Description
The address of unpaired remote device.
Value type
DOMString
Default Value
Empty string ("")