Re: [web-bluetooth] How to add disconnect event handler

In your code, here's how it should look like:

```js
        navigator.bluetooth.requestDevice(options)
            .then(function ( device ) {
                console.log('Name: ' + device.name);
                device.addEventListener( 'gattserverdisconnected', 
handleDisconnect );
                return device.gatt.connect();
            })
            .then(function ( server ) {
                console.log('server ' + server );
                return server.getPrimaryService( MESH_SERVICE_UUID );
            })

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

Received on Tuesday, 14 June 2016 18:58:49 UTC