summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/modules/bluetooth/bluetooth_device.idl
blob: 90d71c919a6a31dcd0659297cd7ae2656f3aac8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright 2014 The Chromium Authors. All rights reserved.
// 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<void> watchAdvertisements(
      optional WatchAdvertisementsOptions options = {});

  readonly attribute DOMString id;
  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)