-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify GATT connection status / behavior #256
Comments
According to #215 (comment), the information leak from telling a Realm whether other Realms are connected seems small enough to accept. What would that change to current behaviour? 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 |
Thanks @beaufortfrancois for re-phrasing and quoting issue #215 , which makes my mind clearer after reading it.. I'm raising the point in along with issues #255 / #253 / #243 related to peripheral's GATT connection state. I'm fine with conclusion of #215, in a sense that we don't need to have 2 events reporting disconnection (physical vs Realms). However, IMO I'd be more comfortable if gatt.connected was reflecting physical connection status. It would be more aligned with currently specified disconnection behavior, where Realm is also notified of https://webbluetoothcg.github.io/web-bluetooth/#eventdef-bluetoothdevice-gattserverdisconnected in case of physical disconnection, also setting With that in place, if other Realm connects to device, or if device is already connected by OS after pairing from bluetooth menu, then We would also indeed have to add a brand new
Again I'm fine with current specification of gatt.connected, but just want to bring other view on it. |
I like having the per-realm boolean (spelled I don't mind having another boolean saying whether there is a physical GATT connection at all, but what's the use case?
I think that's not quite correct: a physical disconnection causes a logical disconnection, and the logical disconnection causes the |
Indeed that's a good description for
Just one warning here, in case system still requires physical connection, UA should leave it open ( see crbug.com/630586 ).
Agree! And also |
A A device (beacon) being disconnected means that it is now broadcasting the URL I've set. The @jyasskin Should I start a specific issue for this? |
This issue is fine. Do you mean a |
Yes. I meant |
Following my reaction in #169 , I'd like to be clear about GATT connection state (app vs physical).
For now it seems that gatt.connected reflects the state of an instance of
BluetoothRemoteGATTServer
being connected to an instance ofBluetoothDevice
(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 havingdevice.gatt.connected === true
in that case?Other concern is the ability to disconnect GATT server. I get the use cases, but maybe its wiser for a start to remove this feature, and leave underlying UA garbage-collect connection(s) on script exit. That would also permit not closing connections if they are needed by the OS. I agree here we can live with it..
The text was updated successfully, but these errors were encountered: