W3C home > Mailing lists > Public > public-web-bluetooth-log@w3.org > May 2016

Re: [web-bluetooth] Specify a Bluetooth Scanning API.

From: François Beaufort via GitHub <sysbot+gh@w3.org>
Date: Fri, 13 May 2016 18:38:54 +0000
To: public-web-bluetooth-log@w3.org
Message-ID: <issue_comment.created-219125983-1463164732-sysbot+gh@w3.org>
This makes more sense now ;)
Thank you @jyasskin!

So once you have a `BluetoothDevice` object, the way to know if you 
have to use `requestDevice` is to check `device.gatt`? But how do you 
make sure that only this device will be shown in the bluetooth 
chooser?

```js

navigator.bluetooth.requestLEScan({
  filters: [{manufacturerData: 0x004C}],
}).then(() => {
  navigator.bluetooth.addEventListener('advertisementreceived', event 
=> {
    if (!event.device.gatt) {
      // How do I connect to this device specifically?
    }
  })
})

-- 
GitHub Notification of comment by beaufortfrancois
Please view or discuss this issue at 
https://github.com/WebBluetoothCG/web-bluetooth/pull/239#issuecomment-219125983
 using your GitHub account
Received on Friday, 13 May 2016 18:38:56 UTC

This archive was generated by hypermail 2.3.1 : Friday, 13 May 2016 18:38:56 UTC