[web-bluetooth] browser not prompting for PIN entry paring (#437)

wenxinleong has just created a new issue for https://github.com/WebBluetoothCG/web-bluetooth:

== browser not prompting for PIN entry paring ==
I have a ble device that display a PIN for pairing. The ble device tested to work with android app BLE Scanner. When it comes to web bluetooth, Window 10's Chrome is not asking for PIN entry and eventually I received error when I try to read value `characteristic.readValue()`:  

> "NetworkError: GATT Error: Not paired."

This is an expected response since pairing is not performed yet. But how can I trigger the prompt for PIN entry on Chrome? 

Few observations:
- If I pre-paired the ble device on my PC (window 10), Chrome has no problem reading the value.
- On Android phone, Chrome has no problem prompt for PIN pairing

Following is the code:

```
const service_uuid = '0000fffe-0000-1000-8000-00805f9b34fb';
const char_uuid = 'f1d0fff3-deaa-ecee-b42f-c9ba7ed623bb';
    navigator.bluetooth.requestDevice({
        acceptAllDevices: true,
        optionalServices: [service_uuid]
    }).then(device => {
        return device.gatt.connect();
    }).then(server => {
        return server.getPrimaryService(service_uuid);
    }).then(service => {
        return service.getCharacteristic(char_uuid);
    }).then(characteristic => {
        console.log('characteristic: ', characteristic);
        return characteristic.readValue();
    }).catch(error => {
        console.log('Argh! ' + error);
    });
```

Chrome: Version 74.0.3729.131 (Official Build) (64-bit)
Window: Window 10


Please view or discuss this issue at https://github.com/WebBluetoothCG/web-bluetooth/issues/437 using your GitHub account

Received on Thursday, 9 May 2019 08:40:09 UTC