W3C home > Mailing lists > Public > public-web-bluetooth-log@w3.org > August 2016

Re: [web-bluetooth] Add a way to include all devices in the chooser.

From: Jeffrey Yasskin via GitHub <sysbot+gh@w3.org>
Date: Mon, 29 Aug 2016 23:51:41 +0000
To: public-web-bluetooth-log@w3.org
Message-ID: <issue_comment.created-243292513-1472514699-sysbot+gh@w3.org>
Thanks @domenic! I've fixed the 'optional' problem; that was just a 
mistake on my part.

["Request Bluetooth 
devices"](https://api.csswg.org/bikeshed/?url=https://raw.githubusercontent.com/jyasskin/web-bluetooth-1/open-filter/index.bs#request-bluetooth-devices)
 does a long task in step 7 and waits for user input in step 9, so it 
can only be used "in parallel". It was easier to write this way, since
 both callers use it in parallel (see [requestDevice(), which uses a 
shorthand you don't really 
like](https://api.csswg.org/bikeshed/?url=https://raw.githubusercontent.com/jyasskin/web-bluetooth-1/open-filter/index.bs#dom-bluetooth-requestdevice)
 and [permissions.request(), which uses the archaic "continue the 
following steps 
asynchronously."](https://w3c.github.io/permissions/#dom-permissions-request)).
 I failed to mark that in note like I've done 
[elsewhere](https://api.csswg.org/bikeshed/?url=https://raw.githubusercontent.com/jyasskin/web-bluetooth-1/open-filter/index.bs#populate-the-bluetooth-cache).

I was avoiding "no filters" as the code for "accept all devices" 
because it leads to the odd situation where 0 filters returns more 
devices than 1 filter, which returns fewer devices than 2 filters. 
However, since the ["request Bluetooth 
devices"](https://api.csswg.org/bikeshed/?url=https://raw.githubusercontent.com/jyasskin/web-bluetooth-1/open-filter/index.bs#request-bluetooth-devices)
 algorithm is internal, maybe that sort of ergonomics matters less. 
This isn't done yet, but I'll start on it.

Thanks for taking a look!

-- 
GitHub Notification of comment by jyasskin
Please view or discuss this issue at 
https://github.com/WebBluetoothCG/web-bluetooth/pull/278#issuecomment-243292513
 using your GitHub account
Received on Monday, 29 August 2016 23:51:54 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 August 2016 23:51:54 UTC