Re: [web-bluetooth] Web Bluetooth with a Custom GATT Service? (#444)

The services that you include in the filters for `requestDevice()` are the services that will be used to filter out devices when a scan is performed. As long as you include the custom defined GATT service UUID, and it is a valid UUID that is not in the blocklist, then the device should be shown in the user prompt.

The line that you referenced from the spec is from step 6.2 of the [scan for devices](https://webbluetoothcg.github.io/web-bluetooth/#scan-for-devices) algorithm. If we follow the steps backwards, the set of Service UUIDs that is used in the algorithm comes from the _requiredServiceUUIDs_ set in  step 7 of the [request Bluetooth devices](https://webbluetoothcg.github.io/web-bluetooth/#request-bluetooth-devices) algorithm. The _requiredServiceUUIDs_ is the result of [canonicalizing](https://webbluetoothcg.github.io/web-bluetooth/#bluetoothlescanfilterinit-canonicalizing) the filters passed into `requestDevice()`, performed in step 2.4.3 of the [request Bluetooth devices](https://webbluetoothcg.github.io/web-bluetooth/#request-bluetooth-devices) algorithm.

The [canonicalizing](https://webbluetoothcg.github.io/web-bluetooth/#bluetoothlescanfilterinit-canonicalizing) algorithm makes sure that the services included in the filter are valid in step 3. It does this by first attempting to [grab the service UUID given a service name](https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothuuid-getservice), or if a UUID is given, it makes sure that it's a [valid UUID](https://webbluetoothcg.github.io/web-bluetooth/#valid-uuid). After this step, it checks if the service UUID is in the [blocklist](https://github.com/WebBluetoothCG/registries/blob/master/gatt_blocklist.txt) and throws a `SecurityError` if it is. Hopefully this explanation makes sense.

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

Received on Tuesday, 18 June 2019 17:31:59 UTC