kaios-types
    Preparing search index...

    Interface BluetoothGatt

    bluetooth

    interface BluetoothGatt {
        connectionState: BluetoothConnectionState;
        oncharacteristicchanged: EventHandler;
        onconnectionstatechanged: EventHandler;
        services: BluetoothGattService[];
        addEventListener(
            type: string,
            callback: EventListenerOrEventListenerObject | null,
            options?: boolean | AddEventListenerOptions,
        ): void;
        connect(): Promise<void>;
        disconnect(): Promise<void>;
        discoverServices(): Promise<void>;
        dispatchEvent(event: Event): boolean;
        readRemoteRssi(): Promise<number>;
        removeEventListener(
            type: string,
            callback: EventListenerOrEventListenerObject | null,
            options?: boolean | EventListenerOptions,
        ): void;
    }

    Hierarchy

    • EventTarget
      • BluetoothGatt
    Index

    Properties

    connectionState: BluetoothConnectionState
    oncharacteristicchanged: EventHandler

    Fired when the value of a characteristic changes.

    onconnectionstatechanged: EventHandler

    Fired when the connection state changes.

    Methods

    • The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.

      MDN Reference

      Parameters

      • type: string
      • callback: EventListenerOrEventListenerObject | null
      • Optionaloptions: boolean | AddEventListenerOptions

      Returns void

    • The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.

      MDN Reference

      Parameters

      • event: Event

      Returns boolean

    • Reads the RSSI (Received Signal Strength Indication) of the remote device.

      Returns Promise<number>

      A Promise resolving to the RSSI value.

    • The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.

      MDN Reference

      Parameters

      • type: string
      • callback: EventListenerOrEventListenerObject | null
      • Optionaloptions: boolean | EventListenerOptions

      Returns void