- From: Ovidio Ruiz-Henríquez via GitHub <sysbot+gh@w3.org>
- Date: Mon, 07 Sep 2020 18:22:39 +0000
- To: public-web-bluetooth-log@w3.org
Yes, if it's not specified, the site does not receive permission to access
the service. This is intended behavior.
On Mon, Sep 7, 2020, 11:40 Eduardo Galeano <notifications@github.com> wrote:
> Hello again:
>
> I managed to get to the service (and to the characteristic after that),
> the solution was adding another service in the optionalServices field and
> then ask for just one of them with server.getPrimaryService, something
> like this:
>
> async function onButtonClick() {
> let device = await navigator.bluetooth.requestDevice({
> acceptAllDevices: true,
> optionalServices: [0x1801, "162348d9-d5a8-4870-8086-8e152fd06a92"]
> });
> let server = await device.gatt.connect();
> console.log(server);
> let service = await server.getPrimaryService("162348d9-d5a8-4870-8086-8e152fd06a92");
> console.log("serviced");
> console.log(service);
> }
>
> If I only specify one of them in optionalServices and try to retrieve it,
> it won't work, is this the expected behavior?
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <https://github.com/WebBluetoothCG/web-bluetooth/issues/513#issuecomment-688428971>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ADXTX3MMT2I6ICWJCNHICA3SEUEGPANCNFSM4Q3GAE5Q>
> .
>
--
GitHub Notification of comment by odejesush
Please view or discuss this issue at https://github.com/WebBluetoothCG/web-bluetooth/issues/513#issuecomment-688464900 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Monday, 7 September 2020 18:22:40 UTC