Bluetooth Permission API integration

This commit is contained in:
Zakor Gyula 2017-01-30 11:30:06 +01:00 committed by Attila Dusnoki
parent f3ddee5dbc
commit 5287cd3bea
17 changed files with 550 additions and 45 deletions

View file

@ -8,7 +8,7 @@
interface BluetoothDevice : EventTarget {
readonly attribute DOMString id;
readonly attribute DOMString? name;
readonly attribute BluetoothRemoteGATTServer gatt;
readonly attribute BluetoothRemoteGATTServer? gatt;
Promise<void> watchAdvertisements();
void unwatchAdvertisements();

View file

@ -0,0 +1,31 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// https://webbluetoothcg.github.io/web-bluetooth/#bluetoothpermissionresult
dictionary BluetoothPermissionDescriptor : PermissionDescriptor {
DOMString deviceId;
// These match RequestDeviceOptions.
sequence<BluetoothLEScanFilterInit> filters;
sequence<BluetoothServiceUUID> optionalServices/* = []*/;
boolean acceptAllDevices = false;
};
dictionary AllowedBluetoothDevice {
required DOMString deviceId;
required boolean mayUseGATT;
// An allowedServices of "all" means all services are allowed.
required (DOMString or sequence<UUID>) allowedServices;
};
dictionary BluetoothPermissionData {
required sequence<AllowedBluetoothDevice> allowedDevices/* = []*/;
};
// [Pref="dom.bluetooth.enabled"]
interface BluetoothPermissionResult : PermissionStatus {
// attribute FrozenArray<BluetoothDevice> devices;
// Workaround until FrozenArray get implemented.
sequence<BluetoothDevice> devices();
};