[web-bluetooth] No services matching UUID help (#513)

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

== No services matching UUID help ==
Hello Everyone:

I've been playing around with WebBluetooth since a couple of days ago, for that I've been using my phone with the nRF Connect app as a GATT Server, and I've been using the next function to attempt the connection with the phone:

  async function onButtonClick() {
   let device = await navigator.bluetooth.requestDevice({
    acceptAllDevices: true,
    optionalServices: [ 0x180D ]
   let server = await device.gatt.connect();
   let service = await server.getPrimaryService(0x180D);

I've been trying the services: `0x181C`, `health_monitor`, `heart_rate`, but the result I'm getting is: `DOMException: No Services matching UUID 000180-0000-1000-8000-00805f9b34fb`; and with the service `"0000aaa0-0000-1000-8000-aabbccddeeff"` I get `DOMException: Origin is not allowed to access the service. Tip: Add the service UUID to 'optionalServices' in requestDevice() options.`

Any ideas of what could be happening, or another way to test this?

Thanks in advance.

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

Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Saturday, 5 September 2020 18:08:44 UTC