W3C home > Mailing lists > Public > public-web-bluetooth@w3.org > March 2015

Re: Security restrictions on web<->device communication

From: Kis, Zoltan <zoltan.kis@intel.com>
Date: Thu, 19 Mar 2015 23:47:10 +0200
Message-ID: <CANrNqUcMq60ecmVMaLt2Wbwr4MhinD1ZLHb_jEsY639D4TN-hQ@mail.gmail.com>
To: Jeffrey Yasskin <jyasskin@google.com>
Cc: public-web-bluetooth <public-web-bluetooth@w3.org>
Hello,

As an additional issue, I would like to ask how do we handle selecting
one from possibly multiple adapters.
There are two basic choices:
1. enumeration + management of adapter id’s (e.g. BT address or
mappings to opaque id’s).
e.g. Promise<sequence<BluetoothAdapter>>  requestAdapters();

2. encapsulated by a dialog or selection algorithm managed by the UA
e.g. Promise<BluetoothAdapter>  requestAdapters();
where the UA decides whether to take a dialog with the user, or use an
algorithm in order to select an adapter.
In addition, we need a property ‘selectedAdapter’ (can be null) and
and event ‘onadapterchanged’.

Based on experience so far, we'd prefer option 2. This has also been
used in the Presentation/Second Screen API [1], and it's useful in
that it does not need to expose adapter id's to web pages, only a
selected object. Of course, this applies mainly for use cases with a
single selection (lists are also manageable with some added
complexity).

A similar scheme could also be used with devices, and services.
For instance, we could use a
Promise<BluetoothGATTService> getPrimaryService(BluetoothServiceUuid service);
method for retrieving the primary service (the UA decides the policy
on how exactly to do that),
and in addition, we need events for serviceadded, serviceremoved, and
servicechanged.

[1] http://w3c.github.io/presentation-api/

Best regards,
Zoltan
Received on Thursday, 19 March 2015 22:28:56 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 19 March 2015 22:28:56 UTC