Web Bluetooth API test

by Masayoshi Kuroda

JavaScript

alert("test");

let options = {};
options.acceptAllDevices = true;

  navigator.bluetooth.requestDevice(options)
  .then(device => {
    log('> Name:             ' + device.name);
    log('> Id:               ' + device.id);
    log('> Connected:        ' + device.gatt.connected);
  })
  .catch(error => {
    alert('Argh! ' + error);
  });