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

I like having the per-realm boolean (spelled `device.gatt.connected` 
today) saying whether that realm is holding the physical GATT 
connection open, because that lets the UA GC the physical connection 
when no more realms are holding it open, even if some realms still 
have a reference to the `BluetoothDevice` object. I also like the 
current state where attempts to use the connection only work if the 
current realm is holding the connection open, because that means the 
UA won't GC the physical connection while a realm is actually trying 
to use it.

I don't mind having another boolean saying whether there is a physical
 GATT connection at all, but what's the use case?

> It would be more aligned with currently specified [disconnection 
behavior](https://webbluetoothcg.github.io/web-bluetooth/#disconnection-events),
 where Realm is also notified of 
[`gattserverdisconnected`](https://webbluetoothcg.github.io/web-bluetooth/#eventdef-bluetoothdevice-gattserverdisconnected)
 in case of physical disconnection

I think that's not quite correct: a physical disconnection causes a 
logical disconnection, and the logical disconnection causes the 
`gattserverdisconnected` event. For the reverse, a physical connection
 wouldn't intrinsically cause a logical connection, so we'd want just 
a `gattserverphysicallyconnected` event.

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

Received on Wednesday, 27 July 2016 22:43:43 UTC