- From: Eduardo Galeano via GitHub <sysbot+gh@w3.org>
- Date: Mon, 07 Sep 2020 16:39:53 +0000
- To: public-web-bluetooth-log@w3.org
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? -- GitHub Notification of comment by Cegard Please view or discuss this issue at https://github.com/WebBluetoothCG/web-bluetooth/issues/513#issuecomment-688428971 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 16:39:55 UTC