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

From MozillaWiki
Jump to navigation Jump to search
mNo edit summary
Line 1: Line 1:
== Overview ==
== Overview ==
'''BluetoothAdapterEvent''' is carried as the parameter 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.
'''BluetoothAdapterEvent''' is carried as the parameter of [[B2G/Bluetooth/WebBluetooth-v2/BluetoothManager#onadapteradded|manager.onadapteradded]] and [[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 [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter|BluetoothAdapter]] object or the address of removed adapter.


== Interface ==
== Interface ==
  interface BluetoothAdapterEvent : Event
  interface BluetoothAdapterEvent : Event
  {
  {
   readonly attribute boolean          [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapterEvent#isDefault isDefault];
   readonly attribute boolean          [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapterEvent#isDefault|isDefault]];
   readonly attribute BluetoothAdapter? [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapterEvent#adapter adapter];
   readonly attribute BluetoothAdapter? [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapterEvent#adapter|adapter]];
   readonly attribute DOMString?        [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapterEvent#address address];
   readonly attribute DOMString?        [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapterEvent#address|address]];
  };
  };


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


=== isDefault ===
=== isDefault ===
Line 27: Line 27:


; Value type
; Value type
: [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter BluetoothAdapter]
: [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter|BluetoothAdapter]]


; Default value
; Default value

Revision as of 02:11, 3 April 2014

Overview

BluetoothAdapterEvent is carried as the parameter 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 ("")