Bluetooth Remote GATT Characteristic class

Hierarchy

  • EventDispatcher<CharacteristicEvents>
    • BluetoothRemoteGATTCharacteristicImpl

Implements

  • BluetoothRemoteGATTCharacteristic

Constructors

Properties

emitter: EventEmitter<DefaultEventMap> = ...
properties: BluetoothCharacteristicProperties

The properties of the characteristic

service: BluetoothRemoteGATTServiceImpl = undefined

The service the characteristic is related to

uuid: string = undefined

The unique identifier of the characteristic

Accessors

  • set oncharacteristicvaluechanged(fn): void
  • Parameters

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

          • ev: Event

          Returns void

    Returns void

  • get value(): DataView
  • The value of the characteristic

    Returns DataView

Methods

  • Type Parameters

    • K extends "characteristicvaluechanged"

    Parameters

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

          • this: this
          • ev: CharacteristicEvents[K]

          Returns void

    Returns void

  • Type Parameters

    • K extends "characteristicvaluechanged"

    Parameters

    • type: K
    • listener: EventListener

    Returns void

  • Parameters

    • event: Event

    Returns boolean

  • Gets a single characteristic descriptor

    Parameters

    • descriptor: string | number

      descriptor UUID

    Returns Promise<BluetoothRemoteGATTDescriptor>

    Promise containing the descriptor

  • Gets a list of the characteristic's descriptors

    Parameters

    • Optionaldescriptor: string | number

      descriptor UUID

    Returns Promise<BluetoothRemoteGATTDescriptor[]>

    Promise containing an array of descriptors

  • Gets the value of the characteristic

    Returns Promise<DataView>

    Promise containing the value

  • Type Parameters

    • K extends "characteristicvaluechanged"

    Parameters

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

          • this: this
          • ev: CharacteristicEvents[K]

          Returns void

    Returns void

  • Type Parameters

    • K extends "characteristicvaluechanged"

    Parameters

    • type: K
    • callback: EventListener

    Returns void

  • Start notifications of changes for the characteristic

    Returns Promise<BluetoothRemoteGATTCharacteristic>

    Promise containing the characteristic

  • Stop notifications of changes for the characteristic

    Returns Promise<BluetoothRemoteGATTCharacteristic>

    Promise containing the characteristic

  • Updates the value of the characteristic

    Parameters

    • value: ArrayBuffer | ArrayBufferView

      The value to write

    Returns Promise<void>

  • Updates the value of the characteristic without waiting for a response

    Parameters

    • value: ArrayBuffer | ArrayBufferView

      The value to write

    Returns Promise<void>

  • Updates the value of the characteristic and waits for a response

    Parameters

    • value: ArrayBuffer | ArrayBufferView

      The value to write

    Returns Promise<void>