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

Jump to navigation Jump to search
Line 68: Line 68:
* [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#discovering|BluetoothAdapter.discovering]]
* [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#discovering|BluetoothAdapter.discovering]]
* [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#pairingReqs|BluetoothAdapter.pairingReqs]]
* [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#pairingReqs|BluetoothAdapter.pairingReqs]]
* [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#gattServer|BluetoothAdapter.gattServer]]


=== state ===
=== state ===
Line 204: Line 205:
     // notify user of just-work pairing
     // notify user of just-work pairing
   }
   }
}
=== gattServer ===
; Description
: The gattServer property is object to conduct GATT server operations on local bluetooth adapter. Applications have to call openGattServer() to update this property.
; Value type
: [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattServer#BluetoothGattServer|BluetoothGattServer]]
; Default value
: Null pointer
; Sample
var adapter = navigator.mozBluetooth.defaultAdapter;
if (adapter) {
  adapter.openGattServer().then ( function onResolve(gattServer) {
    console.log("Resolved with gatt server");
  }, function onReject(aReason) {
    console.log("Rejected with this reason: " + aReason);
  });
  }
  }


Confirmed users
891

edits

Navigation menu