Closed ghost closed 6 years ago
Yes, if I recall well this is how the Windows API is designed - it only establishes a connection when you actually interact with the device (enumerate the services, for instance). Last time I checked (about a year ago), I remember this was the case - you couldn't just ask the API to establish a connection without sending some request.
OK, thanks @urish
No comments on Microsoft's API design! :-)
Simply calling [some device].gatt.connect() does not cause a connection to be established. Is this per the Web Bluetooth specification?
If I test using Chrome on Android, I immediately get a connection. On Windows using the polyfill, I do not get a connection until I initiate service discovery. I've not had time to determine exactly which call triggers connecting but I'm doing things like connected_server.getPrimaryServices() after the then clause of my call to connect() executes.