Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IBluetooth

Represents the bluetooth of the current environment

since

1.0.0

Hierarchy

  • IBluetooth

Implemented by

Index

Properties

onDiscover

onDiscover: function

Callback if a device is discovered.

param

Bluetooth device

Type declaration

onError

onError: function

Callback if an error raises while the discovery process.

param

Discovery error

Type declaration

    • (error: any): any
    • Parameters

      • error: any

      Returns any

state

state: State

Current state of the bluetooth adapter.

timeout

timeout: number

Timeout for discovery process.

Methods

startScanning

  • startScanning(serviceUUIDS?: string[]): Promise<void>
  • Starts the discovery process of the bluetooth adapter. executes the onDiscover callback if a new device is detected or executes the onError callback if any errors occurs from the bluetooth device. Returns a promise that resolves after the discovery process is started or rejects if the process can not be started successfully.

    Parameters

    • Optional serviceUUIDS: string[]

    Returns Promise<void>

    State after discovery process

stopScanning

  • stopScanning(): Promise<void>
  • Stops the discovery Process. Returns a promise that resolves after the process is stopped successfully or rejects if the process can not be stopped orderly.

    Returns Promise<void>

    State after stopping the discovery process

Generated using TypeDoc