Re: Security restrictions on web<->device communication

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