B2G/BluetoothManager

From MozillaWiki
< B2G
Revision as of 03:18, 25 February 2014 by Btian (talk | contribs) (→‎Properties)
Jump to navigation Jump to search

Summary

The BluetoothManager API allows to access all Bluetooth adapters available on the device. Adapters are the connection interface to connect a Bluetooth device to that device.

Interface Overview

interface BluetoothManager: EventTarget
{
  attribute EventHandler onadapteradded;
  attribute EventHandler onadapterremoved;

  BluetoothAdapter[] getAdapters();
  BluetoothAdapter getDefaultAdapter();
};

Properties

  • BluetoothManager.onadapteradded
A handler for the adapteradded event; it is triggered when a Bluetooth adapter is enabled on the device.
  • BluetoothManager.onadapterremoved
A handler for the adapterremoved event; it is triggered when a Bluetooth adapter is disable on the device.

Methods

  • BluetoothManager.getAdapters()
  • BluetoothManager.getDefaultAdapter()