urish / web-bluetooth-polyfill

Windows 10 Web Bluetooth Polyfill
76 stars 15 forks source link

events added by addEventListener for "gattserverdisconnected" does not fire #26

Closed boogerlad closed 7 years ago

boogerlad commented 7 years ago

I have not tested with other events, but maybe all events are broken as well. On a linux machine: https://googlechrome.github.io/samples/web-bluetooth/device-disconnect-async-await.html

clicking disconnect will result in

Requesting Bluetooth Device...
Connecting to Bluetooth Device...
> Bluetooth Device connected
Disconnecting from Bluetooth Device...
> Bluetooth Device disconnected

but doing the same thing on windows will result in

Requesting Bluetooth Device...
Connecting to Bluetooth Device...
> Bluetooth Device connected
Disconnecting from Bluetooth Device...
urish commented 7 years ago

Thanks for reporting! Can you please check if the fix in master works for you?

boogerlad commented 7 years ago

yup :) However, physically disconnecting by shutting the device off does not trigger the event. Could be a windows issue.

urish commented 7 years ago

Great! About shutting down the device - it worked for me at some point in the past, I'll try to see if I can reproduce