interface NativeBluetoothLE {
    addListener: ((eventType: string) => void);
    removeListeners: ((count: number) => void);
    bleInitialize(): Promise<void>;
    bleShutdown(): Promise<void>;
    connectPeripheral(deviceSystemId: string, requiredServicesUuids: undefined | string, timeoutMs: number): Promise<void>;
    createPeripheral(deviceSystemId: string): Promise<Readonly<{
        address: number;
        name: string;
        systemId: string;
    }>>;
    disconnectPeripheral(deviceSystemId: string): Promise<void>;
    getCharacteristicProperties(deviceSystemId: string, serviceUuid: string, characteristicUuid: string, instanceIndex: number): Promise<number>;
    getDiscoveredServices(deviceSystemId: string): Promise<string>;
    getPeripheralAddress(deviceSystemId: string): Promise<number>;
    getPeripheralConnectionStatus(deviceSystemId: string): Promise<ConnectionStatus>;
    getPeripheralMtu(deviceSystemId: string): Promise<number>;
    getPeripheralName(deviceSystemId: string): Promise<string>;
    getServiceCharacteristics(deviceSystemId: string, serviceUuid: string): Promise<string>;
    readCharacteristic(deviceSystemId: string, serviceUuid: string, characteristicUuid: string, instanceIndex: number): Promise<number[]>;
    readPeripheralRssi(deviceSystemId: string): Promise<number>;
    releasePeripheral(deviceSystemId: string): Promise<void>;
    requestPeripheralMtu(deviceSystemId: string, mtu: number): Promise<number>;
    startScan(requiredServicesUuids?: string): Promise<void>;
    stopScan(): Promise<void>;
    subscribeCharacteristic(deviceSystemId: string, serviceUuid: string, characteristicUuid: string, instanceIndex: number): Promise<void>;
    unsubscribeCharacteristic(deviceSystemId: string, serviceUuid: string, characteristicUuid: string, instanceIndex: number): Promise<void>;
    writeCharacteristic(deviceSystemId: string, serviceUuid: string, characteristicUuid: string, instanceIndex: number, data: number[], withoutResponse: boolean): Promise<void>;
}

Hierarchy

  • NativeModule
    • NativeBluetoothLE

Properties

addListener: ((eventType: string) => void)

Add the provided eventType as an active listener

Type declaration

    • (eventType): void
    • Parameters

      • eventType: string

        name of the event for which we are registering listener

      Returns void

removeListeners: ((count: number) => void)

Remove a specified number of events. There are no eventTypes in this case, as the native side doesn't remove the name, but only manages a counter of total listeners

Type declaration

    • (count): void
    • Parameters

      • count: number

        number of listeners to remove (of any type)

      Returns void

Methods

  • Returns Promise<void>

  • Returns Promise<void>

  • Parameters

    • deviceSystemId: string
    • requiredServicesUuids: undefined | string
    • timeoutMs: number

    Returns Promise<void>

  • Parameters

    • deviceSystemId: string

    Returns Promise<Readonly<{
        address: number;
        name: string;
        systemId: string;
    }>>

  • Parameters

    • deviceSystemId: string

    Returns Promise<void>

  • Parameters

    • deviceSystemId: string
    • serviceUuid: string
    • characteristicUuid: string
    • instanceIndex: number

    Returns Promise<number>

  • Parameters

    • deviceSystemId: string

    Returns Promise<string>

  • Parameters

    • deviceSystemId: string

    Returns Promise<number>

  • Parameters

    • deviceSystemId: string

    Returns Promise<ConnectionStatus>

  • Parameters

    • deviceSystemId: string

    Returns Promise<number>

  • Parameters

    • deviceSystemId: string

    Returns Promise<string>

  • Parameters

    • deviceSystemId: string
    • serviceUuid: string

    Returns Promise<string>

  • Parameters

    • deviceSystemId: string
    • serviceUuid: string
    • characteristicUuid: string
    • instanceIndex: number

    Returns Promise<number[]>

  • Parameters

    • deviceSystemId: string

    Returns Promise<number>

  • Parameters

    • deviceSystemId: string

    Returns Promise<void>

  • Parameters

    • deviceSystemId: string
    • mtu: number

    Returns Promise<number>

  • Parameters

    • OptionalrequiredServicesUuids: string

    Returns Promise<void>

  • Returns Promise<void>

  • Parameters

    • deviceSystemId: string
    • serviceUuid: string
    • characteristicUuid: string
    • instanceIndex: number

    Returns Promise<void>

  • Parameters

    • deviceSystemId: string
    • serviceUuid: string
    • characteristicUuid: string
    • instanceIndex: number

    Returns Promise<void>

  • Parameters

    • deviceSystemId: string
    • serviceUuid: string
    • characteristicUuid: string
    • instanceIndex: number
    • data: number[]
    • withoutResponse: boolean

    Returns Promise<void>