Central: {
    addEventListener: (<T>(type, listener) => void);
    connectPeripheral: ((peripheral, opt?) => Promise<void>);
    disconnectPeripheral: ((peripheral) => Promise<void>);
    getBluetoothState: (() => BluetoothState);
    getCharacteristicProperties: ((peripheral, serviceUuid, characteristicUuid, instanceIndex?) => Promise<number>);
    getDiscoveredServices: ((peripheral) => Promise<string[]>);
    getPeripheralMtu: ((peripheral) => Promise<number>);
    getPeripheralName: ((peripheral) => Promise<string>);
    getScanStatus: (() => ScanStatus);
    getServiceCharacteristics: ((peripheral, serviceUuid) => Promise<string[]>);
    initialize: (() => void);
    isInitialized: (() => boolean);
    readCharacteristic: ((peripheral, serviceUuid, characteristicUuid, options?) => Promise<Uint8Array>);
    readPeripheralRssi: ((peripheral, _timeoutMs?) => Promise<number>);
    removeEventListener: (<T_1>(type, listener) => void);
    shutdown: (() => void);
    startScan: ((services, scanCallback) => Promise<void>);
    stopScan: (() => Promise<void>);
    subscribeCharacteristic: ((peripheral, serviceUuid, characteristicUuid, onValueChanged, options?) => Promise<void>);
    unsubscribeCharacteristic: ((peripheral, serviceUuid, characteristicUuid, options?) => Promise<void>);
    writeCharacteristic: ((peripheral, serviceUuid, characteristicUuid, data, options?) => Promise<void>);
}

Type declaration

  • Readonly addEventListener: (<T>(type, listener) => void)
      • <T>(type, listener): void
      • Type Parameters

        Parameters

        • type: T
        • listener: ((ev) => void)

        Returns void

  • Readonly connectPeripheral: ((peripheral, opt?) => Promise<void>)
      • (peripheral, opt?): Promise<void>
      • Parameters

        • peripheral: PeripheralOrSystemId
        • Optional opt: {
              connectionStatusCallback?: ((ev) => void);
              timeout?: number;
          }
          • Optional connectionStatusCallback?: ((ev) => void)
          • Optional timeout?: number

        Returns Promise<void>

  • Readonly disconnectPeripheral: ((peripheral) => Promise<void>)
  • Readonly getBluetoothState: (() => BluetoothState)
  • Readonly getCharacteristicProperties: ((peripheral, serviceUuid, characteristicUuid, instanceIndex?) => Promise<number>)
      • (peripheral, serviceUuid, characteristicUuid, instanceIndex?): Promise<number>
      • Parameters

        • peripheral: PeripheralOrSystemId
        • serviceUuid: string
        • characteristicUuid: string
        • Optional instanceIndex: number

        Returns Promise<number>

  • Readonly getDiscoveredServices: ((peripheral) => Promise<string[]>)
  • Readonly getPeripheralMtu: ((peripheral) => Promise<number>)
  • Readonly getPeripheralName: ((peripheral) => Promise<string>)
  • Readonly getScanStatus: (() => ScanStatus)
  • Readonly getServiceCharacteristics: ((peripheral, serviceUuid) => Promise<string[]>)
      • (peripheral, serviceUuid): Promise<string[]>
      • Parameters

        Returns Promise<string[]>

  • Readonly initialize: (() => void)
      • (): void
      • Returns void

  • Readonly isInitialized: (() => boolean)
      • (): boolean
      • Returns boolean

  • Readonly readCharacteristic: ((peripheral, serviceUuid, characteristicUuid, options?) => Promise<Uint8Array>)
      • (peripheral, serviceUuid, characteristicUuid, options?): Promise<Uint8Array>
      • Parameters

        • peripheral: PeripheralOrSystemId
        • serviceUuid: string
        • characteristicUuid: string
        • Optional options: {
              instanceIndex?: number;
              timeoutMs?: number;
          }
          • Optional instanceIndex?: number
          • Optional timeoutMs?: number

        Returns Promise<Uint8Array>

  • Readonly readPeripheralRssi: ((peripheral, _timeoutMs?) => Promise<number>)
      • (peripheral, _timeoutMs?): Promise<number>
      • Parameters

        Returns Promise<number>

  • Readonly removeEventListener: (<T_1>(type, listener) => void)
  • Readonly shutdown: (() => void)
      • (): void
      • Returns void

  • Readonly startScan: ((services, scanCallback) => Promise<void>)
      • (services, scanCallback): Promise<void>
      • Parameters

        • services: string | string[]
        • scanCallback: ((ev) => void)
            • (ev): void
            • Parameters

              Returns void

        Returns Promise<void>

  • Readonly stopScan: (() => Promise<void>)
      • (): Promise<void>
      • Returns Promise<void>

  • Readonly subscribeCharacteristic: ((peripheral, serviceUuid, characteristicUuid, onValueChanged, options?) => Promise<void>)
      • (peripheral, serviceUuid, characteristicUuid, onValueChanged, options?): Promise<void>
      • Parameters

        • peripheral: PeripheralOrSystemId
        • serviceUuid: string
        • characteristicUuid: string
        • onValueChanged: ((ev) => void)
        • Optional options: {
              instanceIndex?: number;
              timeoutMs?: number;
          }
          • Optional instanceIndex?: number
          • Optional timeoutMs?: number

        Returns Promise<void>

  • Readonly unsubscribeCharacteristic: ((peripheral, serviceUuid, characteristicUuid, options?) => Promise<void>)
      • (peripheral, serviceUuid, characteristicUuid, options?): Promise<void>
      • Parameters

        • peripheral: PeripheralOrSystemId
        • serviceUuid: string
        • characteristicUuid: string
        • Optional options: {
              instanceIndex?: number;
              timeoutMs?: number;
          }
          • Optional instanceIndex?: number
          • Optional timeoutMs?: number

        Returns Promise<void>

  • Readonly writeCharacteristic: ((peripheral, serviceUuid, characteristicUuid, data, options?) => Promise<void>)
      • (peripheral, serviceUuid, characteristicUuid, data, options?): Promise<void>
      • Parameters

        • peripheral: PeripheralOrSystemId
        • serviceUuid: string
        • characteristicUuid: string
        • data: ArrayBuffer
        • Optional options: {
              instanceIndex?: number;
              timeoutMs?: number;
              withoutResponse?: boolean;
          }
          • Optional instanceIndex?: number
          • Optional timeoutMs?: number
          • Optional withoutResponse?: boolean

        Returns Promise<void>

Generated using TypeDoc