Bluetooth Device class

Hierarchy

  • EventDispatcher<BluetoothDeviceEvents>
    • BluetoothDeviceImpl

Implements

  • BluetoothDevice

Constructors

Properties

emitter: EventEmitter = ...
gatt: BluetoothRemoteGATTServer = undefined

The gatt server of the device

id: string = undefined

The unique identifier of the device

name: string = undefined

The name of the device

watchingAdvertisements: boolean = false

Whether adverts are being watched (not implemented)

Accessors

  • set onadvertisementreceived(fn: (ev: Event) => void): void
  • Parameters

    • fn: (ev: Event) => void

    Returns void

  • set oncharacteristicvaluechanged(fn: (ev: Event) => void): void
  • Parameters

    • fn: (ev: Event) => void

    Returns void

  • set ongattserverdisconnected(fn: (ev: Event) => void): void
  • Parameters

    • fn: (ev: Event) => void

    Returns void

  • set onserviceadded(fn: (ev: Event) => void): void
  • Parameters

    • fn: (ev: Event) => void

    Returns void

  • set onservicechanged(fn: (ev: Event) => void): void
  • Parameters

    • fn: (ev: Event) => void

    Returns void

  • set onserviceremoved(fn: (ev: Event) => void): void
  • Parameters

    • fn: (ev: Event) => void

    Returns void

Methods

  • Type Parameters

    • K extends keyof BluetoothDeviceEvents

    Parameters

    • type: K
    • listener: (this: this, ev: BluetoothDeviceEvents[K]) => void

    Returns void

  • Type Parameters

    • K extends keyof BluetoothDeviceEvents

    Parameters

    • type: K
    • listener: EventListener

    Returns void

  • Parameters

    • event: Event

    Returns boolean

  • Forget this device

    Returns Promise<void>

  • Type Parameters

    • K extends keyof BluetoothDeviceEvents

    Parameters

    • type: K
    • callback: (this: this, ev: BluetoothDeviceEvents[K]) => void

    Returns void

  • Type Parameters

    • K extends keyof BluetoothDeviceEvents

    Parameters

    • type: K
    • callback: EventListener

    Returns void

  • Stops watching adverts from this device (not implemented)

    Returns Promise<void>

  • Starts watching adverts from this device (not implemented)

    Returns Promise<void>