Re: [web-bluetooth] Clarify GATT connection status / behavior

> 
For now it seems that 
[gatt.connected](https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattserver-connected)
 reflects the state of an instance of `BluetoothRemoteGATTServer` 
being connected to an instance of `BluetoothDevice` (pure software 
matters). If we consider underlying connection from central to 
peripheral, we might already be connected to the peripheral (device) 
in question : why not having `device.gatt.connected === true` in that 
case?

According to 
https://github.com/WebBluetoothCG/web-bluetooth/issues/215#issue-136155982,
  _the information leak from telling a Realm whether other Realms are 
connected seems small enough to accept_. 

What would that change to current behaviour?

```js
navigator.bluetooth.requestDevice({filters: [{services: 
['battery_service']}]})
.then(device => {
  if (!device.gatt.connected) {
    return device.gatt.connect();
  } else {
    // Already connected.
    return Promise.resolve();
  }
})
...
```

Are you thinking that one realm having bluetooth device foo getting 
connected would trigger in a second realm a brand new 
`gattserverconnected` event? Should we poll for the 
`device.gatt.connected` boolean status?

-- 
GitHub Notification of comment by beaufortfrancois
Please view or discuss this issue at 
https://github.com/WebBluetoothCG/web-bluetooth/issues/256#issuecomment-235518218
 using your GitHub account

Received on Wednesday, 27 July 2016 08:20:00 UTC