B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapterEvent

From MozillaWiki
< B2G‎ | Bluetooth‎ | WebBluetooth-v2
Revision as of 07:53, 7 April 2014 by Btian (talk | contribs)
Jump to navigation Jump to search

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

BluetoothAdapterEvent

interface BluetoothAdapterEvent : Event
{
  readonly attribute boolean                isDefault;
  readonly attribute BluetoothAdapterHandle handle;
};

BluetoothAdapterHandle

interface BluetoothAdapterHandle
{
  readonly attribute BluetoothAdapter? adapter;
  readonly attribute DOMString?        address;
};

BluetoothAdapterEvent

Properties

isDefault

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

handle

Description
The handle contains either the added BluetoothAdapter object or the address of the removed adapter.
Value type
BluetoothAdapterHandle

BluetoothAdapterHandle

Properties

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 ("")