Bluetooth Device class

Hierarchy

  • EventDispatcher<BluetoothDeviceEvents>
    • BluetoothDeviceImpl

Implements

  • BluetoothDevice

Constructors

Properties

emitter: EventEmitter<DefaultEventMap> = ...
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): void
  • Parameters

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

          • ev: Event

          Returns void

    Returns void

  • set oncharacteristicvaluechanged(fn): void
  • Parameters

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

          • ev: Event

          Returns void

    Returns void

  • set ongattserverdisconnected(fn): void
  • Parameters

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

          • ev: Event

          Returns void

    Returns void

  • set onserviceadded(fn): void
  • Parameters

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

          • ev: Event

          Returns void

    Returns void

  • set onservicechanged(fn): void
  • Parameters

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

          • ev: Event

          Returns void

    Returns void

  • set onserviceremoved(fn): void
  • Parameters

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

          • ev: Event

          Returns void

    Returns void

Methods

  • Type Parameters

    • K extends keyof BluetoothDeviceEvents

    Parameters

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

          • this: this
          • ev: BluetoothDeviceEvents[K]

          Returns 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)
        • (this, ev): void
        • Parameters

          • this: this
          • ev: BluetoothDeviceEvents[K]

          Returns 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>