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

Jump to navigation Jump to search
Line 33: Line 33:


; Description
; Description
: A handler to trigger when a bluetooth adapter is unplugged from the device. The event carries <tt>evt.address</tt> as the address of unplugged [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter BluetoothAdapter]. The unplugged [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter BluetoothAdapter] object is already unavailable. Applications should call [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothManager#getDefaultAdapter.28.29 getDefaultAdapter()] in this event handler to retrieve the latest default adapter, and [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothManager#getAdapters.28.29 getAdapters()] for the latest array of adapters on the device.
: A handler to trigger when a bluetooth adapter is unplugged from the device. The event carries <tt>evt.address</tt> as the address of unplugged [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter BluetoothAdapter]. The unplugged [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter BluetoothAdapter] object is already unavailable and access to its attributes returns default values. Applications should call [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothManager#getDefaultAdapter.28.29 getDefaultAdapter()] in this event handler to retrieve the latest default adapter, and [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothManager#getAdapters.28.29 getAdapters()] for the latest array of adapters on the device.


; Sample
; Sample
Confirmed users
891

edits

Navigation menu