chromium/third_party/blink/renderer/modules/bluetooth/bluetooth_remote_gatt_server.idl

// Copyright 2015 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/#bluetoothremotegattserver

// Implement BluetoothGATTRemoteServer interface: https://crbug.com/476735

[
    Exposed=Window,
    RuntimeEnabled=WebBluetooth,
    SecureContext
] interface BluetoothRemoteGATTServer
{
    [SameObject] readonly attribute BluetoothDevice device;
    readonly attribute boolean connected;
    [CallWith=ScriptState, RaisesException, MeasureAs=WebBluetoothRemoteServerConnect] Promise<BluetoothRemoteGATTServer> connect();
    [CallWith=ScriptState, RaisesException, MeasureAs=WebBluetoothRemoteServerDisconnect] void disconnect();
    [CallWith=ScriptState, RaisesException, MeasureAs=WebBluetoothRemoteServerGetPrimaryService] Promise<BluetoothRemoteGATTService> getPrimaryService (BluetoothServiceUUID service);
    [CallWith=ScriptState, RaisesException, MeasureAs=WebBluetoothRemoteServerGetPrimaryServices] Promise<sequence<BluetoothRemoteGATTService>> getPrimaryServices (optional BluetoothServiceUUID service);
};