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

Jump to navigation Jump to search
no edit summary
No edit summary
Line 197: Line 197:


; Sample
; Sample
  device.fetchUuids().then { function onResolve(uuids) {
  device.fetchUuids().then ( function onResolve(uuids) {
   console.log("Resolved with uuids:");
   console.log("Resolved with uuids:");
   for (var i = 0; i < uuids.length; i++) {   
   for (var i = 0; i < uuids.length; i++) {   
Line 224: Line 224:
  var autoConnect = false;
  var autoConnect = false;
   
   
  device.connectGatt(autoConnect).then { function onResolve(gatt) {
  device.connectGatt(autoConnect).then ( function onResolve(gatt) {
   // gatt.connectionState is connected.
   // gatt.connectionState is connected.
   console.log("Resolved with gatt. Connection state:", gatt.connectionState);
   console.log("Resolved with gatt. Connection state:", gatt.connectionState);
120

edits

Navigation menu