UNPKG

webbluetooth

Version:

Node.js implementation of the Web Bluetooth Specification

47 lines (46 loc) 1.37 kB
import { BluetoothDeviceImpl } from './device'; /** * Bluetooth Remote GATT Server class */ export declare class BluetoothRemoteGATTServerImpl implements BluetoothRemoteGATTServer { /** * The device the gatt server is related to */ readonly device: BluetoothDeviceImpl; private _connected; /** * Whether the gatt server is connected */ get connected(): boolean; /** * @hidden */ _handle: string; private services; /** * Server constructor * @param device Device the gatt server relates to */ constructor(device: BluetoothDeviceImpl); /** * Connect the gatt server * @returns Promise containing the gatt server */ connect(): Promise<BluetoothRemoteGATTServer>; /** * Disconnect the gatt server */ disconnect(): void; /** * Gets a single primary service contained in the gatt server * @param service service UUID * @returns Promise containing the service */ getPrimaryService(service: BluetoothServiceUUID): Promise<BluetoothRemoteGATTService>; /** * Gets a list of primary services contained in the gatt server * @param service service UUID * @returns Promise containing an array of services */ getPrimaryServices(service?: BluetoothServiceUUID): Promise<Array<BluetoothRemoteGATTService>>; }