mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Bluetooth Permission API integration
This commit is contained in:
parent
f3ddee5dbc
commit
5287cd3bea
17 changed files with 550 additions and 45 deletions
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue