Preparing search index...

    Interface GATTSubscriptionHandle

    Handle returned by subscribeGATT. Allows ad-hoc writes and lifecycle monitoring.

    interface GATTSubscriptionHandle {
        connected: boolean;
        close(): Promise<void>;
        onConnect(callback: () => void): void;
        onDisconnect(callback: () => void): void;
        read(charUuid: string): Promise<Buffer<ArrayBufferLike>>;
        write(
            charUuid: string,
            data: Buffer,
            withResponse?: boolean,
        ): Promise<void>;
    }
    Index
    connected: boolean

    Whether the underlying GATT connection is currently active

    • Called when the GATT connection (re-)establishes

      Parameters

      • callback: () => void

      Returns void

    • Write to a characteristic on the connected device

      Parameters

      • charUuid: string
      • data: Buffer
      • OptionalwithResponse: boolean

      Returns Promise<void>