Confirmed users
185
edits
mNo edit summary |
|||
| Line 5: | Line 5: | ||
interface BluetoothManager: EventTarget | interface BluetoothManager: EventTarget | ||
{ | { | ||
attribute EventHandler [ | attribute EventHandler [[B2G/Bluetooth/WebBluetooth-v2/BluetoothManager#onadapteradded|onadapteradded]]; | ||
attribute EventHandler [ | attribute EventHandler [[B2G/Bluetooth/WebBluetooth-v2/BluetoothManager#onadapterremoved|onadapterremoved]]; | ||
any [ | any [[B2G/Bluetooth/WebBluetooth-v2/BluetoothManager#getAdapters.28.29|getAdapters()]]; // array of BluetoothAdapter | ||
BluetoothAdapter [ | BluetoothAdapter [[B2G/Bluetooth/WebBluetooth-v2/BluetoothManager#getDefaultAdapter.28.29|getDefaultAdapter()]]; | ||
}; | }; | ||
== Event Handlers == | == Event Handlers == | ||
* [ | * [[B2G/Bluetooth/WebBluetooth-v2/BluetoothManager#onadapteradded|BluetoothManager.onadapteradded]] | ||
* [ | * [[B2G/Bluetooth/WebBluetooth-v2/BluetoothManager#onadapterremoved|BluetoothManager.onadapterremoved]] | ||
=== onadapteradded === | === onadapteradded === | ||
| Line 23: | Line 23: | ||
; Parameter | ; Parameter | ||
: ''aAdapterEvent'' | : ''aAdapterEvent'' | ||
:: The event is a [ | :: The event is a [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapterEvent|BluetoothAdapterEvent]] with property [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapterEvent#adapter|adapter]] as the added bluetooth adapter and property [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapterEvent#isDefault|isDefault]] indicating whether the added adapter is default adapter. | ||
; Sample | ; Sample | ||
| Line 44: | Line 44: | ||
; Parameter | ; Parameter | ||
: ''aAddressEvent'' | : ''aAddressEvent'' | ||
:: The event is a [ | :: The event is a [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapterEvent|BluetoothAdapterEvent]] with property [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapterEvent#address|address]] as the address of removed bluetooth adapter and property [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapterEvent#isDefault|isDefault]] indicating whether the removed adapter is default adapter. | ||
; Sample | ; Sample | ||
| Line 60: | Line 60: | ||
== Methods == | == Methods == | ||
* [ | * [[B2G/Bluetooth/WebBluetooth-v2/BluetoothManager#getAdapters.28.29|BluetoothManager.getAdapters()]] | ||
* [ | * [[B2G/Bluetooth/WebBluetooth-v2/BluetoothManager#getDefaultAdapter.28.29|BluetoothManager.getDefaultAdapter()]] | ||
=== getAdapters() === | === getAdapters() === | ||
| Line 69: | Line 69: | ||
; Return | ; Return | ||
: An array of [ | : An array of [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter|BluetoothAdapter]] objects. | ||
; Sample | ; Sample | ||
| Line 81: | Line 81: | ||
; Return | ; Return | ||
: The default [ | : The default [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter|BluetoothAdapter]] object. | ||
; Sample | ; Sample | ||
| Line 88: | Line 88: | ||
== See also == | == See also == | ||
* [ | * [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter|BluetoothAdapter]] | ||