title: Web Bluetooth discovering by Service uuid
body: <p>I'm trying to write a web app to interact with a Eddystone beacon. The beacon advertise a URL for the app and exposes a service and 2 characteristics.</p>
  
  <p>My device has the following services and characteristics as shown by gatttool on linux</p>
  
  <pre><code>$ gatttool -I 
  [00:1A:7D:DA:71:15][LE]&gt; connect 00:1A:7D:DA:71:15 
  Attempting to connect to 00:1A:7D:DA:71:15 
  Connection successful 
  [00:1A:7D:DA:71:15][LE]&gt; primary 
  attr handle: 0x0001, end grp handle: 0x0005 uuid: 00001800-0000-1000-8000-00805f9b34fb 
  attr handle: 0x0006, end grp handle: 0x0009 uuid: 00001801-0000-1000-8000-00805f9b34fb 
  attr handle: 0x000a, end grp handle: 0x0012 uuid: ba42561b-b1d2-440a-8d04-0cefb43faece 
  [00:1A:7D:DA:71:15][LE]&gt; characteristics 
  handle: 0x0002, char properties: 0x02, char value handle: 0x0003, uuid: 00002a00-0000-1000-8000-00805f9b34fb 
  handle: 0x0004, char properties: 0x02, char value handle: 0x0005, uuid: 00002a01-0000-1000-8000-00805f9b34fb 
  handle: 0x0007, char properties: 0x20, char value handle: 0x0008, uuid: 00002a05-0000-1000-8000-00805f9b34fb 
  handle: 0x000b, char properties: 0x1a, char value handle: 0x000c, uuid: 6bcb06e2-7475-42a9-a62a-54a1f3ce11e6 
  handle: 0x000f, char properties: 0x1a, char value handle: 0x0010, uuid: 6bcb06e2-7475-42a9-a62a-54a1f3ce11e5 
  [00:1A:7D:DA:71:15][LE]
  </code></pre>
  
  <p>I'm working from the example <a href="https://developers.google.com/web/updates/2015/07/interact-with-ble-devices-on-the-web?hl=en" rel="nofollow">here</a></p>
  
  <pre><code>if (navigator.bluetooth) {
    console.log("bluetooth found");
    navigator.bluetooth.requestDevice({
      filters: [{
        services: ['ba42561b-b1d2-440a-8d04-0cefb43faece']
      }]
    })
    .then(device =&gt; {
      bluetoothDevice = device;
      console.log(device.name);
      console.log(device.uuids);
      device.connectGATT();
    })
    .then(server =&gt; {
      return server.getPrimaryService('ba42561b-b1d2-440a-8d04-0cefb43faece');
    })
    .then(service =&gt; {
      return service.getCharacteristic('6bcb06e2-7475-42a9-a62a-54a1f3ce11e6');
    })
    .then( characteristic =&gt; {
      var toggleOn = new Uint8Array([1]);
      return characteristic.writeValue(toggleOn);
    })
    .catch(error =&gt; { 
      console.log("error:- " + error); 
    });
  }
  </code></pre>
  
  <p>This code never finds the device. If I change the <em>filter</em> to use the <code>namePrefix</code> it finds the device but only lists one of the services and not the one I'm interested in.</p>
  
  <p>Anybody know what I'm doing wrong with the discovery and finding the right services?</p>