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

Jump to navigation Jump to search
Line 19: Line 19:


; Description
; Description
: A handler to trigger when a bluetooth adapter is plugged into the device. The event carries <tt>evt.adapter</tt> as the plugged [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter BluetoothAdapter]. Applications should call [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothManager#getDefaultAdapter.28.29 getDefaultAdapter()] in this event handler to retrieve the current default adapter if there is no adapter plugged in, suggest to call [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothManager#getAdapters.28.29 getAdapters()] for the most updated array of adapters on the device.
: A handler to trigger when a bluetooth adapter is plugged into the device.
 
; Parameter
: ''aAdapterEvent''
:: The event is a [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothAddressEvent BluetoothAdapterEvent] with property [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapterEvent#adapter adapter] as the added bluetooth adapter and isDefault indicating whether the added adapter is default adapter.


; Sample
; Sample
Confirmed users
891

edits

Navigation menu