// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// https://webbluetoothcg.github.io/web-bluetooth/#bluetoothdevice
[
ActiveScriptWrappable,
Exposed=Window,
RuntimeEnabled=WebBluetooth,
SecureContext
] interface BluetoothDevice : EventTarget {
[
RuntimeEnabled=WebBluetoothWatchAdvertisements,
CallWith=ScriptState,
RaisesException,
MeasureAs=WebBluetoothWatchAdvertisements
] Promise<undefined> watchAdvertisements(
optional WatchAdvertisementsOptions options = {});
[
RuntimeEnabled=WebBluetoothGetDevices,
CallWith=ScriptState,
RaisesException,
MeasureAs=BluetoothDeviceForget
] Promise<undefined> forget();
readonly attribute DOMString id;
[HighEntropy=Direct, MeasureAs=BluetoothDeviceName] readonly attribute DOMString? name;
readonly attribute BluetoothRemoteGATTServer gatt;
[RuntimeEnabled=WebBluetoothWatchAdvertisements] readonly attribute boolean watchingAdvertisements;
[RuntimeEnabled=WebBluetoothWatchAdvertisements] attribute EventHandler onadvertisementreceived;
attribute EventHandler ongattserverdisconnected;
};
// TODO: Include ServiceEventHandlers mixin (https://crbug.com/421670)