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

From MozillaWiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
== Overview ==
== Overview ==
'''BluetoothAdapterEvent''' is carried as the argument of [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothManager#onadapteradded manager.onadapteradded] event handler. Applications can get the added [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter BluetoothAdapter] object and knows whether the added adapter is default adapter.
'''BluetoothAdapterEvent''' is carried as the argument of [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothManager#onadapteradded manager.onadapteradded] and [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothManager#onadapterremoved manager.onadapterremoved] event handlers. Applications can know whether the added/removed adapter is default adapter, and get the added [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter BluetoothAdapter] object or the address of removed adapter.


== Interface ==
== Interface ==

Revision as of 03:13, 21 March 2014

Overview

BluetoothAdapterEvent is carried as the argument of manager.onadapteradded and manager.onadapterremoved event handlers. Applications can know whether the added/removed adapter is default adapter, and get the added BluetoothAdapter object or the address of removed adapter.

Interface

interface BluetoothAdapterEvent : Event
{
  readonly attribute boolean isDefault;

  readonly attribute BluetoothAdapter? adapter;
  readonly attribute DOMString? address;
};

Properties

isDefault

Description
Whether the added/removed adapter is default adapter (true) or not (false).
Value type
boolean

adapter

Description
The added adapter.
Value type
BluetoothAdapter
Default value
Null pointer

address

Description
The address of removed adapter.
Value type
DOMString
Default value
Empty string ("")