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

Jump to navigation Jump to search
Line 23: Line 23:
; Parameter
; Parameter
: ''aAdapterEvent''
: ''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.
:: 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 [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapterEvent#isDefault isDefault] indicating whether the added adapter is default adapter.


; Sample
; Sample
  function bt_onAdapterAdded(evt) {
  function bt_onAdapterAdded(evt) {
   var adapter = evt.adapter;
   var adapter = evt.adapter;
   // do your thing here!
   var isDefaultAdapter = evt.isDefault;
  if (isDefaultAdapter) {
    // do your things here.
  }
  }
  }
   
   
Confirmed users
891

edits

Navigation menu